import 'package:equatable/equatable.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction_offer_type.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction_ownership_type.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction_revocation_info.dart';
import 'package:backend.core/core/domain/entities/app_store/app_store_transaction.dart';

class AppStorePurchasedSubscriptionTransaction extends Equatable implements AppStoreTransaction {
  const AppStorePurchasedSubscriptionTransaction({
    required this.id,
    required this.time,
    required this.appStoreUserId,
    required this.originalTransactionId,
    required this.purchaseItemSku,
    required this.offerType,
    required this.ownershipType,
    required this.test,
    required this.revocationInfo,
    required this.expirationTime,
  });

  @override
  final String id;

  @override
  final DateTime time;

  @override
  final String appStoreUserId;

  @override
  final String originalTransactionId;

  @override
  final String purchaseItemSku;

  @override
  final AppStoreTransactionOfferType offerType;

  @override
  final AppStoreTransactionOwnershipType ownershipType;

  @override
  final bool test;

  @override
  final AppStoreTransactionRevocationInfo? revocationInfo;

  final DateTime expirationTime;

  @override
  List<Object?> get props {
    return [
      id,
      time,
      appStoreUserId,
      originalTransactionId,
      purchaseItemSku,
      offerType,
      ownershipType,
      test,
      revocationInfo,
      expirationTime,
    ];
  }
}
